﻿@page "/rating"

<RadzenExample Name="Rating">
<div class="row">
    <div class="col-md-6">
        <h3>Rating with 5 stars</h3>
        <RadzenRating Style="margin-bottom: 20px" Change="@((args) => Change(args, "Rating with 5 stars"))" />
        <br />
        <h3>Rating with 10 stars</h3>
        <RadzenRating Stars="10" Style="margin-bottom: 20px" Change="@((args) => Change(args, "Rating with 10 stars"))" />
        <br />
        <h3>Disabled Rating with 10 stars</h3>
        <RadzenRating Disabled="true" Stars="10" Style="margin-bottom: 20px" Change="@((args) => Change(args, "Disabled Rating with 10 stars"))" />
    </div>
    <div class="col-md-6">
        <h3>Events</h3>
        <RadzenCard style="overflow: auto;height:500px;">
            @foreach (var e in events.OrderByDescending(i => i.Key))
            {
                @e.Value
                <br />
            }
        </RadzenCard>
    </div>
</div>
</RadzenExample>

@code {
    Dictionary<DateTime, string> events = new Dictionary<DateTime, string>();

    void Change(int value, string name)
    {
        events.Add(DateTime.Now, $"{name} value changed to {value}");
    }
}
